//
//  PlayListCollectionViewCell.m
//  Products_B
//
//  Created by lanou on 16/5/30.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "PlayListCollectionViewCell.h"

@interface PlayListCollectionViewCell() {
    UIImageView *_dishImageView;
    UILabel *_label;
}

@end

@implementation PlayListCollectionViewCell



- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _dishImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kWidth / 2, kWidth / 2)];
        _dishImageView.userInteractionEnabled = YES;
        [self.contentView addSubview:_dishImageView];
        
        UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom];
        playButton.frame = CGRectMake((_dishImageView.frame.size.width - 40) / 2, (_dishImageView.frame.size.height - 40) / 2, 40, 40);
        [playButton setImage:[UIImage imageNamed:@"CookClassPlay.png"] forState:UIControlStateNormal];
        [_dishImageView addSubview:playButton];
        
        _label = [[UILabel alloc] initWithFrame:CGRectMake(5, _dishImageView.frame.size.height + 10, self.frame.size.width - 20, 20)];
        _label.textAlignment = NSTextAlignmentCenter;
        _label.font = [UIFont systemFontOfSize:14];
        _label.alpha = 0.5;
        [self.contentView addSubview:_label];
 
    }
    return self;
}

- (void)setAboutClassModel:(AboutClassModel *)aboutClassModel {
    _aboutClassModel = aboutClassModel;
    [_dishImageView sd_setImageWithURL:[NSURL URLWithString:aboutClassModel.dishes_image]];
    _label.text = aboutClassModel.dishes_title;
}

@end
